<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <script src="js/jquery-3.6.0.min.js"></script>
    <script src="js/template-web.js"></script>
    <script src="js/cmt.js"></script>
</head>
<body style="padding: 15px">
    <!-- 评论面板 -->
    
    <div class="panel panel-primary">
          <div class="panel-heading">
                <h3 class="panel-title">发表评论</h3>
          </div>
          <form class="panel-body" id="formAddCmt">
                <div>评论人：</div>
                <input type="text" name="username" class="form-control" />
                <div>评论内容：</div>
                <textarea class="form-control" name="content"></textarea>
                <button type="submit" class="btn btn-primary">发表评论</button>
          </form>
    </div>
    

    <!-- 评论列表 -->
    
    <ul class="list-group"></ul>

    <script type="text/html" id="cmtList">
        {{each data}}
        <li class="list-group-item">
            <span class="badge" style="background-color: #F0AD4E;">评论时间：{{$value.time}}</span>
            <span class="badge" style="background-color: #5BC0DE;">评论人：{{$value.username}}</span>
            {{$value.content}}
        </li>
        {{/each}}
    </script>
    
    
</body>
</html>